home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / BBS / EZY120_1.ZIP / STRUCT.ARJ / CLIB.ARJ / FLOG.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-09  |  749 b   |  38 lines

  1.  
  2. #include <ezylib.h>
  3. #include <stdio.h>
  4. #include <errno.h>
  5. #include <dos.h>
  6.  
  7. FILE *hSystemLog;
  8.  
  9. int OpenSystemLog(char *Filename)
  10. {
  11.   int Result;
  12.   if ((hSystemLog = fopen(Filename,"at")) != NULL) {
  13.     date d;
  14.     getdate(&d);
  15.     fprintf(hSystemLog,"\n----------  %02d-%s-%d\n",d.da_day,ShortMonths[d.da_mon-1],d.da_year);
  16.     Result = TRUE;
  17.   } else {
  18.     printf("%s opening %s",sys_errlist[errno],Filename);
  19.     Result = FALSE;
  20.   }
  21.   return(Result);
  22. }
  23.  
  24. void WriteSystemLog(char *Description)
  25. {
  26.   if (hSystemLog != NULL) {
  27.     date d;
  28.     time t;
  29.     gettime(&t);
  30.     fprintf(hSystemLog,"> %02d:%02d:%02d  %s\n",t.ti_hour,t.ti_min,t.ti_sec,Description);
  31.   }
  32. }
  33.  
  34. void CloseSystemLog()
  35. {
  36.   fclose(hSystemLog);
  37. }
  38.